package com.mini.demos.webgame.msg;

import java.math.BigDecimal;

import com.mini.demos.webgame.util.CommandConstants;

public class LoginMsgResp extends AbstractGameMsg {
	
	private Integer code;
	
	private String userName;
	
	private String nickName;
	
	private Integer sex;
	
	private Float knowledge;
	
	private Float money;

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	
	public Float getKnowledge() {
		return knowledge;
	}

	public void setKnowledge(Float knowledge) {
		this.knowledge = knowledge;
	}

	public Float getMoney() {
		return money;
	}

	public void setMoney(Float money) {
		this.money = money;
	}

	public Integer getBodyLength(){
		Integer splitLength = CommandConstants.COMMAND_SPLIT.getBytes().length;
		Integer sum = 0;
		sum += 4;
		sum += this.getUserName().getBytes().length;
		sum += splitLength.intValue();
		sum += this.getNickName().getBytes().length;
		sum += splitLength.intValue();
		sum += 4;
		sum += splitLength.intValue();
		sum += 4;
		sum += splitLength.intValue();
		sum += 4;
		return sum;
	}

}
